﻿<%@ Page Language="C#" Inherits="E.Web.training.score.View" %>
<%@ Import Namespace="E.Model" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head>
  <title>试卷查看</title>
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  <link rel="stylesheet" href="/css/main.css" type="text/css" media="all" />
  <link rel="stylesheet" href="/css/t_main.css" type="text/css" media="all" />
  <link rel="stylesheet" href="/css/t_score.css" type="text/css" media="all" />
  <style type="text/css">
    .box_1{ margin-top:10px; width:650px; display:table; }
    .left{ width:140px; line-height:20px; _line-height:23px; display:table; }
    .dis_r{ line-height:20px; _line-height:23px; display:table; }
  </style>
  <script type="text/javascript">
    var OptionIndex = ["A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z"];
    function SetAnswer() {
      var answer = document.getElementById("aa").value;
      var a = answer.split("$$");
      //      alert(a);
      for (var i = 0; i < a.length; i++) {
        if (a[i].trim() != "") {
          if (a[i].indexOf(",") == -1) {
            document.getElementById("cb_" + i + "_" + GetValueIndex(a[i])).checked = true;
          } else {
            var b = a[i].split(",");
            for (var z = 0; z < b.length; z++) {
              document.getElementById("cb_" + i + "_" + GetValueIndex(b[z])).checked = true;
            }
          }
        }
      }
    }
    function GetValueIndex(v) { 
      var index = 0;
      for (var i = 0; i < OptionIndex.length; i++) {
        if (v == OptionIndex[i]) {
          index = i;
          break;
        }
      }
      return index;
    }
    function trim(str) {
      for (var i = 0; i < str.length && str.charAt(i) == "  "; i++);
      for (var j = str.length; j > 0 && str.charAt(j - 1) == "  "; j--);
      if (i > j) return "";
      return str.substring(i, j);
    } 

  </script>
  <script language="javascript">
/**  
*删除左右两端的空格  
*/  
String.prototype.trim=function(){      
    return this.replace(/(^\s*)|(\s*$)/g, '');   
}     
/**  
*删除左边的空格  
*/  
String.prototype.ltrim=function()   
{   
  return this.replace(/(^s*)/g,'');   
}   
/**  
*删除右边的空格  
*/  
String.prototype.rtrim=function()   
{   
  return this.replace(/(s*$)/g,'');   
}   
</script>
</head>
<body>
  <form id="form1" method="post" action="">
    <div class="block_2">
      <div style="width:650px; height:22px;">
        <div class="title">&nbsp;试卷信息</div>
      </div>
      <div class="spe_line_2"></div>
      <div class="box_1">
        <div class="fl tr left">试卷名称：</div>
        <div class="fl dis_r"><%=model.ExamTitle %></div>
      </div>
      <div class="box_1">
        <div class="fl tr left">开始时间：</div>
        <div class="fl dis_r"><%=model.StartTime %></div>
      </div>
      <div class="box_1">
        <div class="fl tr left">提交时间：</div>
        <div class="fl dis_r"><%=model.SubmitTime %></div>
      </div>
      <div class="box_1">
        <div class="fl tr left">分数：</div>
        <div class="fl dis_r"><%=model.Score %></div>
      </div>
    </div>
    <div class="block_2">
      <div style="width:650px; height:22px;">
        <div class="title">&nbsp;考题信息</div>
      </div>
      <div class="spe_line_2"></div>
      
      <% if (model.QuestionList != null && model.QuestionList.Count > 0)
         { %>
        <% int i = 0, subjectQuestionCount = 0; %>
        <% foreach (ExamQuestionModel e in model.QuestionList)
           { if (!(e.CategoryID.Equals(4) || e.CategoryID.Equals(5)))
               { %>
      <div class="box_1" style="font-weight:bolder;">
        <div class="fl tr left">题型：</div>
        <div class="fl dis_r"><%=e.CategoryName %></div>
      </div>
            <% int j = 0; %>
            <% foreach (QuestionModel q in e.CategoryQuestionList) { %>
            
      <div class="box_1">
        <div class="fl tr left"><%=j + 1 %>：</div>
        <div class="fl dis_r"><%=q.Title %></div>
      </div>
      <div class="box_1">
        <div class="fl tr left">&nbsp;</div>
        <div class="fl dis_r">
          <ul>
          <% int z = 0; %>
          <% foreach (QuestionOptionModel o in q.OptionList) { %>
            <li>
              <div style="width:500px; display:table;">
                <div class="fl" style="padding-top:2px;"><input type="checkbox" id="cb_<%=i %>_<%=z %>" name="cb_<%=j %>" disabled="disabled" /></div>
                <div class="fl">&nbsp;<%=GetSerialNo(o.SerialNumber) %>：<%=o.OptionTitle %><%= o.IsCorrect ? "<span class=\"hint\">（正确选项）</span>" : "" %></div>
              </div>
            </li>
            <% z++; %>
          <% } %>
          </ul>
        </div>
      </div>
      
          <% i++; %>
          
              <% j++; %>
            <% } %>
          <% //i++; %>
        <% } else{%>
          <!-- 主观题 -->
          <div class="box_1" style="font-weight:bolder;">
            <div class="fl tr left">题型：</div>
            <div class="fl dis_r"><%=e.CategoryName%></div>
            </div>
            <% int j = 0; %>
                <% foreach (QuestionModel q in e.CategoryQuestionList)
                    {%>
            <div class="box_1">
            <div class="fl tr left"><%=j + 1%>：</div>
            <div class="fl dis_r"><%=q.Title%></div>
            </div>
            <div class="box_1">
            <div class="fl tr left">&nbsp;</div>
            <div class="fl dis_r">
                <ul>
                <li>
                    <div style="width:500px; display:table;">
                    <div style="padding-top:2px;"><textarea id="sq_<%=subjectQuestionCount %>" name="sq_<%=subjectQuestionCount %>" cols="50" rows="5" disabled="disabled"  ><%=model.SubjectiveAnswerArray[subjectQuestionCount] %></textarea></div>
                    <!--<div class="fl" style="padding-top:2px;">分数：<input type="text" id="subjectQuestionScore_<%=subjectQuestionCount %>" name="subjectQuestionScore_<%=subjectQuestionCount %>" value="<%=model.SubjectScore.Length > 0?model.SubjectScore[subjectQuestionCount]:0 %>" onblur="ifScoreMoreThanDefaultScore(<%=q.MaxScore %>,this)" /> </div>-->
                    </div>
                </li>
                </ul>
            </div>
            </div>
      
                <% i++; subjectQuestionCount++; %>
                <% j++; %>
                <% } %>
          <!-- 主观题 end-->


          <%} %>
        <% } %>
      <% } %>
      <input type="hidden" id="aa" name="aa" value="<%=model.AnswerArray %>" />
      <div style="height:60px; margin:0 auto; width:100px; text-align:center; margin-top:20px;"><a href="/training/score/ScoreStatistics.aspx" style="color:#090;">返回</a></div>
    </div>
  <script type="text/javascript">
    SetAnswer();
  </script>
  </form>
</body>
</html>
